package com.ruoyi.user.service;

import java.util.LinkedList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.support.Convert;
import com.ruoyi.user.domain.Health;
import com.ruoyi.user.domain.bo.HealthResponseBo;
import com.ruoyi.user.mapper.HealthMapper;

/**
 * 心率/血压/血氧 服务层实现
 * 
 * @author ruoyi
 * @date 2018-12-23
 */
@Service
public class HealthServiceImpl implements IHealthService 
{
	@Autowired
	private HealthMapper healthMapper;

	/**
     * 查询心率/血压/血氧信息
     * 
     * @param id 心率/血压/血氧ID
     * @return 心率/血压/血氧信息
     */
    @Override
	public Health selectHealthById(Integer id)
	{
	    return healthMapper.selectHealthById(id);
	}
	
	/**
     * 查询心率/血压/血氧列表
     * 
     * @param health 心率/血压/血氧信息
     * @return 心率/血压/血氧集合
     */
	@Override
	public List<Health> selectHealthList(Health health)
	{
	    return healthMapper.selectHealthList(health);
	}
	
    /**
     * 新增心率/血压/血氧
     * 
     * @param health 心率/血压/血氧信息
     * @return 结果
     */
	@Override
	public int insertHealth(Health health)
	{
	    return healthMapper.insertHealth(health);
	}
	
	/**
     * 修改心率/血压/血氧
     * 
     * @param health 心率/血压/血氧信息
     * @return 结果
     */
	@Override
	public int updateHealth(Health health)
	{
	    return healthMapper.updateHealth(health);
	}

	/**
     * 删除心率/血压/血氧对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteHealthByIds(String ids)
	{
		return healthMapper.deleteHealthByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Health> selectHealthNewList(String imec) {
		return healthMapper.selectHealthNewList(imec);
	}
	
	@Override
	public List<Health> selectFiveHealthList(String imec) {
		return healthMapper.selectFiveHealthList(imec);
	}

	@Override
	public LinkedList<HealthResponseBo> selectHealthListByday(String imei, String day) {
		return healthMapper.selectHealthListByday(imei,day);
	}

	@Override
	public List<Health> selectHealthAnalysisList(String date) {
		return healthMapper.selectHealthAnalysisList(date);
	}
	
	@Override
	public List<Health> selectHealthAnalysisListOne(String date) {
		return healthMapper.selectHealthAnalysisListOne(date);
	}
	
}
